package day9;
import java.util.Scanner;
public class Fangfa {
    //定义一个判断条件
    int answer = -1;
    public void kehu(){
        System.out.println("请选择查看客户信息管理业务");
        System.out.println("1显示所有客户信息");
        System.out.println("2添加客户信息");
        System.out.println("3修改客户信息");
        System.out.println("4查询客户信息");
        System.out.println("5返回上层");
        Scanner scanner = new Scanner(System.in);
        int num1 = scanner.nextInt();
        Fangfa1 fangfa1 = new Fangfa1();
        switch (num1){
            case 1:
                fangfa1.fun();
                break;
            case 2:
                fangfa1.fun1();
                break;
            case 3:
                fangfa1.fun3();
                break;
            case 4:
                fangfa1.fun4();
                break;
            case 5:
                fangfa1.fun5();
                break;
        }
    }
    public void gouwu(){
        System.out.println("K38 购物系统");
        do {
            System.out.println("输入0返回:");
            Scanner scanner1 = new Scanner(System.in);

            answer=scanner1.nextInt();
            if(answer!=0) {
                System.out.println("输入0返回:");
            }
        }while(answer!=0);
    }
    public void huikui(){//真情回馈方法
        System.out.println("k38 真情回馈");
        do {
            System.out.println("输入0返回:");
            Scanner scanner1 = new Scanner(System.in);

            answer=scanner1.nextInt();
            if(answer!=0) {
                System.out.println("输入0返回:");
            }
        }while(answer!=0);
    }
    public void zhuxiao(){//注销方法
        System.out.println("k38注销");
        do {
            System.out.println("输入0返回:");
            Scanner scanner1 = new Scanner(System.in);

            answer=scanner1.nextInt();
            if(answer!=0) {
                System.out.println("输入0返回:");
            }
        }while(answer!=0);
    }
    public void tuichu(){//退出方法
        System.out.println("k38退出");
        do {
            System.out.println("输入0返回:");
            Scanner scanner1 = new Scanner(System.in);

            answer=scanner1.nextInt();
            if(answer!=0) {
                System.out.println("输入0返回:");
            }
        }while(answer!=0);
    }
    public void chongzhi(){//充值方法
        System.out.println("顾客你好，你在我们商城余额还有" + Person.money);
        System.out.println("请选择你要充值多少钱.1.10000 2.2000 3.3000");
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        switch (num){
            case 1:
                System.out.println("充值10000元");
                Person.money = (Person.money + 10000);
                System.out.println("余额" +(Person.money));
                if (Person.money>10000){
                    System.out.println("恭喜你成为我们商城的高级vip");
                }else {
                    System.out.println("你离我们高级会员还差" + (20000-Person.money));
                }
                break;
            case 2:
                System.out.println("充值2000元");
                Person.money = (Person.money + 2000);
                System.out.println("余额" +(Person.money));
                if (Person.money>3000){
                    System.out.println("恭喜你成为我们商城的中级vip");
                }else {
                    System.out.println("你离我们中级会员还差" + (3000-Person.money));
                }
                break;
            case 3:
                System.out.println("充值3000元");
                Person.money = (Person.money + 3000);
                System.out.println("余额" +(Person.money));
                if (Person.money>3000){
                    System.out.println("恭喜你成为我们商城的初级vip");
                }else {
                    System.out.println("你离我们初级会员还差" + (5000-Person.money));
                }
                break;
        }

        do {
            System.out.println("输入0返回:");
            Scanner scanner1 = new Scanner(System.in);

            answer=scanner1.nextInt();
            if(answer!=0) {
                System.out.println("输入0返回:");
            }
        }while(answer!=0);
    }
    public void huodong(){
        System.out.println("欢迎来到我们商场的活动中心，参加活动有2000积分");
        System.out.println("请选择你要参加哪种活动 1.脑力运动 2.体力运动");
        Scanner scanner10 = new Scanner(System.in);
        int num1 = scanner10.nextInt();
        switch (num1){
            case 1:
                System.out.println("欢迎参加我们商城的脑力运动");
                System.out.println("活动规则：我们随机抽取两个两位数的，需要口算，算对的获奖，没有时间限制");
                int shu1 = (int) (Math.random()*89 +10);
                int shu2 = (int) (Math.random()*100+10);
                System.out.println("这两个数分别是" + shu1+"\n"+shu2);
                System.out.println("请输入答案");
                Scanner scanner11 = new Scanner(System.in);
                int daan = scanner11.nextInt();
                if (daan==(shu1*shu2)){
                    System.out.println("恭喜你，答对了，你获得了一双篮球鞋");
                    Person.jifeng = (Person.jifeng + 2000);
                    System.out.println("你的积分为" + Person.jifeng);
                }else {
                    Person.jifeng = (Person.jifeng + 2000);
                    System.out.println("很遗憾，你答错，没有奖励,只获得积分的提升");
                    System.out.println("你的积分为" + Person.jifeng);
                }
                break;
            case 2:
                System.out.println("欢迎参加我们商城的体力运动");
                System.out.println("活动规则：打字练习，提供一段文字，打字，没有错字，获得奖励");
                String zifu = "我喜欢Java开发，前端开发我的最爱";
                System.out.println("请打字:" + zifu);
                Scanner scanner12 = new Scanner(System.in);
                String zifu1 = scanner12.next();
                if (zifu1.equals(zifu)){
                    Person.jifeng = (Person.jifeng + 2000);
                    System.out.println("恭喜你，答对了，你获得了一部苹果笔记本电脑");
                    System.out.println("你的积分为" + Person.jifeng);
                }else {
                    Person.jifeng = (Person.jifeng + 2000);
                    System.out.println("很遗憾，你答错，没有奖励,只获得积分的提升");
                    System.out.println("你的积分为" + Person.jifeng);
                }
        }
        do {
            System.out.println("输入0返回:");
            Scanner scanner1 = new Scanner(System.in);

            answer=scanner1.nextInt();
            if(answer!=0) {
                System.out.println("输入0返回:");
            }
        }while(answer!=0);
    }
    public void jifen(){//积分方法
        System.out.println("欢迎来到积分界面");
        System.out.println("你的积分是" + Person.jifeng);
        System.out.println("可以用积分兑换一下东西 1.笔记本电脑 10000积分 2.篮球鞋 1000积分 3.衣服 1000积分");
        System.out.println("请选择你要兑换哪个东西");
        Scanner scanner14 =new Scanner(System.in);
        int num4 = scanner14.nextInt();
        switch (num4){
            case 1:
                if (Person.jifeng>10000){
                    System.out.println("兑换成功，获得一部笔记本电脑");
                }else {
                    System.out.println("积分余额不足");
                }
                break;
            case 2:
                if (Person.jifeng>=1000){
                    System.out.println("篮球鞋和衣服都可以兑换，请选择1.篮球鞋2.衣服");
                    Scanner scanner15 = new Scanner(System.in);
                    int num5 = scanner15.nextInt();
                    switch (num5){
                        case 1 :
                            System.out.println("恭喜你，获得了篮球鞋");
                            break;
                        case 2 :
                            System.out.println("恭喜你，获得了衣服");
                            break;
                    }
                }else {
                    System.out.println("积分余额不足");
                }
                break;
            case 3:
                if (Person.jifeng>=1000){
                    System.out.println("篮球鞋和衣服都可以兑换，请选择1.篮球鞋2.衣服");
                    Scanner scanner16 = new Scanner(System.in);
                    int num6 = scanner16.nextInt();
                    switch (num6){
                        case 1 :
                            System.out.println("恭喜你，获得了篮球鞋");
                            break;
                        case 2 :
                            System.out.println("恭喜你，获得了衣服");
                            break;
                    }
                }else {
                    System.out.println("积分余额不足");
                }
                break;
        }
        do {
            System.out.println("输入0返回:");
            Scanner scanner1 = new Scanner(System.in);

            answer=scanner1.nextInt();
            if(answer!=0) {
                System.out.println("输入0返回:");
            }
        }while(answer!=0);
    }
}


